package com.hp.bon.sgw.dr;

import com.hp.ocs.diameter.message.Message;
import com.hp.ocs.diameter.node.Peer;

public class DrCallParam
{
  protected String auditKey;
  protected String sessionId;
  private long timeOutTime = 0L;
  private Message request;
  private String toPeerHostId;
  private DrProcessor drProcessor;
  private DrDCCAsynCallHandler drDccAsynCallHandler;
  private Peer fromPeer;
  private boolean wait4Resend;
  private int retCode;
  private String resultMsg;
  public static final int MSG_INPROCESS = 0;
  public static final int MSG_WAIT_SEND_REQ = 1;
  public static final int MSG_WAIT_SEND_ANSW = 2;
  public static final int REQ_SEND_FAILED = 3;
  public static final int REQ_WAIT_RESPONSE = 4;
  public static final int MSG_SENDING = 5;
  public static final int MSG_SEND_FAILED = 6;
  public static final int REQ_SUC = 8;
  public static final int REQ_ERROR = 9;
  public static final int REQ_NORESPONE = 10;
  private long inQueueTime;

  public String getToPeerHostId()
  {
    return this.toPeerHostId;
  }

  public void setToPeerHostId(String toPeerHostId) {
    this.toPeerHostId = toPeerHostId;
  }

  public boolean isWait4Resend()
  {
    return this.wait4Resend;
  }

  public void setWait4Resend(boolean wait4Resend) {
    this.wait4Resend = wait4Resend;
  }

  public String getSessionId() {
    return this.sessionId;
  }

  public void setSessionId(String sessionId) {
    this.sessionId = sessionId;
  }

  public Peer getFromPeer() {
    return this.fromPeer;
  }

  public void setFromPeer(Peer fromPeer) {
    this.fromPeer = fromPeer;
  }

  public DrDCCAsynCallHandler getDrDccAsynCallHandler()
  {
    return this.drDccAsynCallHandler;
  }

  public void setDrDccAsynCallHandler(DrDCCAsynCallHandler drDccAsynCallHandler) {
    this.drDccAsynCallHandler = drDccAsynCallHandler;
  }

  public DrProcessor getDrProcessor() {
    return this.drProcessor;
  }

  public void setDrProcessor(DrProcessor drProcessor) {
    this.drProcessor = drProcessor;
  }

  public String getAuditKey() {
    return this.auditKey;
  }

  public void setAuditKey(String auditKey) {
    this.auditKey = auditKey;
  }

  public Message getRequest()
  {
    return this.request;
  }

  public void setRequest(Message request) {
    this.request = request;
  }

  public int getRetCode() {
    return this.retCode;
  }

  public void setRetCode(int retCode) {
    this.retCode = retCode;
  }

  public String getResultMsg() {
    return this.resultMsg;
  }

  public void setResultMsg(String resultMsg) {
    this.resultMsg = resultMsg;
  }

  public long getTimeOutTime()
  {
    return this.timeOutTime;
  }

  public void setTimeOutTime(long timeOutTime) {
    this.timeOutTime = timeOutTime;
  }

  public DrCallParam(String auditKey, Message request, Peer fromPeer, DrDCCAsynCallHandler drDccAsynCallHandler, String sessionId, String toPeerHostId)
  {
    this.auditKey = auditKey;
    this.request = request;
    this.fromPeer = fromPeer;
    this.toPeerHostId = toPeerHostId;
    this.sessionId = sessionId;
    this.drDccAsynCallHandler = drDccAsynCallHandler;
    this.drProcessor = new DrProcessor();
    this.wait4Resend = false;
  }

  public long getRecvReqTime()
  {
    if (this.request == null) {
      return 0L;
    }
    if ((this.request instanceof Message)) {
      return this.request._rt0;
    }
    return -1L;
  }

  public long getInQueueTime()
  {
    return this.inQueueTime;
  }

  public void setInQueueTime(long inQueueTime) {
    this.inQueueTime = inQueueTime;
  }
}
